<#import "../../layout.html" as c>
<#import "../../list_layout.html" as list>
<#assign alertList = []/>
<#assign alertList = alertList + ["代理商列表默认显示全部代理商，可通过快速查询来搜索产品。"]/>
<#assign alertList = alertList + ["可以在操作列进行代理商编辑等操作。"]/>
<@c.html title="Index">
<@list.html title="代理商列表" subTitle="代理商列表" alertList=alertList permi="sys:agent:save" addBtn=true searchHint="请输入代理商名称进行搜索">
</@list.html>
    <!-- ================== 开始页面所需CSS引入 ================== -->
    <!-- 富文本编辑器 -->
    <link type="text/css" rel="stylesheet" href="${pluginsRoot}ueditor/themes/default/css/ueditor.css">
    <link type="text/css" rel="stylesheet" href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/WdatePicker.css" />
    <link type="text/css" rel="stylesheet" href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/default/datepicker.css" />
    <!-- ================== 开始页面所需CSS引入 ================== -->

    <!-- 开始用户权限参数 &ndash;&gt;-->
    <@shiro.hasPermission name="sys:agent:save">
    <input type="hidden" id="agentSave" value="1"/>
    </@shiro.hasPermission>

    <@shiro.hasPermission name="sys:agent:next">
    <input type="hidden" id="agentNext" value="1"/>
    </@shiro.hasPermission>

    <@shiro.hasPermission name="sys:agent:edit">
    <input type="hidden" id="agentEdit" value="1"/>
    </@shiro.hasPermission>

    <@shiro.hasPermission name="sys:agent:del">
    <input type="hidden" id="agentDel" value="1"/>
    </@shiro.hasPermission>

    <@shiro.hasPermission name="sys:agent:recharge">
    <input type="hidden" id="agentRecharge" value="1"/>
    </@shiro.hasPermission>

    <@shiro.hasPermission name="sys:agent:cash">
    <input type="hidden" id="agentCash" value="1"/>
    </@shiro.hasPermission>

    <!-- 开始新增产品模态窗口 -->
    <div class="modal fade" id="addModal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title"> 新增代理商 <a class="btn btn-info btn-xs m-l-5" role="button" data-toggle="collapse" href="#OperationTips" aria-expanded="true" title="操作提示"><i class="fa fa-exclamation"></i> 提示 </a> </h4>
                </div>
                <div class="modal-body">
                    <ul class="collapse in text-info p-b-10 p-l-15" role="tabpanel" id="OperationTips">
                        <li>代理商名称等为必填项，请根据表单提示信息正确输入选择。</li>
                    </ul>
                    <form class="form-horizontal form-bordered p-0" action="${adminRoot}agent/json/save" id="addForm" method="post" autocomplete="off" data-parsley-validate="true">
                        <input type="hidden" name="flag" value="">
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">代理商名称&nbsp;:<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                            <div class="col-md-9 col-sm-8">
                                <input type="text" name="name" class="form-control" placeholder="请输入代理商名称" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，只能填写中文、数字、英文、：:、()、（）、[]、-及空格且输入内容小于50个字符。"  maxlength="50" data-parsley-required="true"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">手续费分成比例&nbsp;:<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                            <div class="col-md-9 col-sm-8">
                                <input type="text" name="feeRate" class="form-control" placeholder="请输入手续费分成比例" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，只能填写数字且输入内容小于5个字符。"  maxlength="5" data-parsley-required="true"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">过夜费分成比例&nbsp;:<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                            <div class="col-md-9 col-sm-8">
                                <input type="text" name="overnightRate" class="form-control" placeholder="请输入过夜费分成比例" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，只能填写数字且输入内容小于5个字符。"  maxlength="5" data-parsley-required="true"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">用户亏损分成比例</label>
                            <div class="col-md-9 col-sm-8">
                                <input type="text" name="loseRate" class="form-control" placeholder="请输入用户亏损分成比例" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，只能填写数字且输入内容小于5个字符。"  maxlength="5" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">是否收取用户亏损分成&nbsp;: </label>
                            <div class="col-md-9 col-sm-8">
                                <input type="checkbox" class="addLose" autocomplete="off"
                                       data-input-name="loseIsOpen"
                                       data-size="small"
                                       data-on-color="primary"
                                       data-on-text="是"
                                       data-off-text="否"
                                       data-input-true="1"
                                       data-input-false="2"
                                       checked/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">代理商状态&nbsp;: </label>
                            <div class="col-md-9 col-sm-8">
                                <input type="checkbox" class="addStatus" autocomplete="off"
                                       data-input-name="status"
                                       data-size="small"
                                       data-on-color="primary"
                                       data-on-text="正常"
                                       data-off-text="冻结"
                                       data-input-true="1"
                                       data-input-false="2"
                                       checked/>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer"><a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a><a href="javascript:;" class="btn btn-success" data-loading-text="Loading..." nc-ajax-submit-target="addForm" nc-ajax-submit>确认提交</a></div>
            </div>
        </div>
    </div>
    <!-- 结束新增产品模态窗口 -->

    <!-- 开始编辑产品模态窗口 -->
    <div class="modal fade" id="editModal" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> 编辑代理商 <a class="btn btn-info btn-xs m-l-5" role="button" data-toggle="collapse" href="#OperationTipsEdit" aria-expanded="true" title="操作提示"><i class="fa fa-exclamation"></i> 提示 </a> </h4>
            </div>
            <div class="modal-body">
                <ul class="collapse in text-info p-b-10 p-l-15" role="tabpanel" id="OperationTipsEdit">
                    <li>代理商名称等必填项，请根据表单提示信息正确输入选择。</li>
                </ul>
                <form class="form-horizontal form-bordered p-0" action="${adminRoot}agent/json/edit" id="editForm" method="post" autocomplete="off" data-parsley-validate="true">
                    <input type="hidden" name="id" value="">
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">代理商名称&nbsp;:<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                        <div class="col-md-9 col-sm-8">
                            <input type="text" id="name" class="form-control" autocomplete="off" data-tip="tooltip" data-placement="auto" readonly/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">手续费分成比例&nbsp;:<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                        <div class="col-md-9 col-sm-8">
                            <input type="text" name="feeRate" class="form-control" placeholder="请输入手续费分成比例" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，只能填写数字且输入内容小于5个字符。"  maxlength="5" data-parsley-required="true"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">过夜费分成比例&nbsp;:<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                        <div class="col-md-9 col-sm-8">
                            <input type="text" name="overnightRate" class="form-control" placeholder="请输入过夜费分成比例" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，只能填写数字且输入内容小于5个字符。"  maxlength="5" data-parsley-required="true"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">用户亏损分成比例&nbsp;:<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                        <div class="col-md-9 col-sm-8">
                            <input type="text" name="loseRate" class="form-control" placeholder="请输入用户亏损分成比例" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，只能填写数字且输入内容小于5个字符。"  maxlength="5" data-parsley-required="true"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">是否收取用户亏损分成&nbsp;: </label>
                        <div class="col-md-9 col-sm-8">
                            <input type="checkbox" class="editLose" autocomplete="off"
                                   data-input-name="loseIsOpen"
                                   data-size="small"
                                   data-on-color="primary"
                                   data-on-text="是"
                                   data-off-text="否"
                                   data-input-true="1"
                                   data-input-false="2"
                                   checked/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">代理商状态&nbsp;: </label>
                        <div class="col-md-9 col-sm-8">
                            <input type="checkbox" class="editStatus" autocomplete="off"
                                   data-input-name="status"
                                   data-size="small"
                                   data-on-color="primary"
                                   data-on-text="正常"
                                   data-off-text="冻结"
                                   data-input-true="1"
                                   data-input-false="2"
                                   checked/>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer"><a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a><a href="javascript:;" class="btn btn-success" data-loading-text="Loading..." nc-ajax-submit-target="editForm" nc-ajax-submit>确认提交</a></div>
        </div>
    </div>
</div>
    <!-- 开始编辑产品模态窗口 -->

    <!-- 开始代理商入金模态窗口-->
    <div class="modal fade" id="recharge" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> 入金 <a class="btn btn-info btn-xs m-l-5" role="button" data-toggle="collapse" href="#OperationTipsReCharge" aria-expanded="true" title="操作提示"><i class="fa fa-exclamation"></i> 提示 </a> </h4>
            </div>
            <div class="modal-body">
                <ul class="collapse in text-info p-b-10 p-l-15" role="tabpanel" id="OperationTipsReCharge">
                    <li>代理商入金</li>
                </ul>
                <form class="form-horizontal form-bordered p-0" action="${adminRoot}agent/json/recharge" id="rechargeForm" method="post" autocomplete="off" data-parsley-validate="true">
                    <input type="hidden" name="id" value="">
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">金额&nbsp;:<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                        <div class="col-md-9 col-sm-8">
                            <input type="text" name="amount" class="form-control" placeholder="请输入金额" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，只能填写数字、且输入内容小于11个字符。"  maxlength="11" data-parsley-required="true"/>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer"><a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a><a href="javascript:;" class="btn btn-success" data-loading-text="Loading..." nc-ajax-submit-target="rechargeForm" nc-ajax-submit>确认提交</a></div>
        </div>
    </div>
</div>
   <!--结束代理商入金模态窗口-->

   <!--开始代理商出金模态窗口-->
    <div class="modal fade" id="cash" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> 出金 <a class="btn btn-info btn-xs m-l-5" role="button" data-toggle="collapse" href="#OperationTipsCash" aria-expanded="true" title="操作提示"><i class="fa fa-exclamation"></i> 提示 </a> </h4>
            </div>
            <div class="modal-body">
                <ul class="collapse in text-info p-b-10 p-l-15" role="tabpanel" id="OperationTipsCash">
                    <li>代理商出金</li>
                </ul>
                <form class="form-horizontal form-bordered p-0" action="${adminRoot}agent/json/cash" id="cashForm" method="post" autocomplete="off" data-parsley-validate="true">
                    <input type="hidden" name="id" value="">
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">金额&nbsp;:<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                        <div class="col-md-9 col-sm-8">
                            <input type="text" name="amount" class="form-control" placeholder="请输入金额" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，只能填写数字、且输入内容小于11个字符。"  maxlength="11" data-parsley-required="true"/>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer"><a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a><a href="javascript:;" class="btn btn-success" data-loading-text="Loading..." nc-ajax-submit-target="cashForm" nc-ajax-submit>确认提交</a></div>
        </div>
    </div>
</div>
  <!--结束代理商出金模态窗口-->



<!-- ================== 开始页面级JavaScrip调用 ================== -->
    <!-- 表单checkbox项 -->
    <script src="${pluginsRoot}bootstrap-switch/bootstrap-switch.min.js"></script>

    <script src="${pluginsRoot}ueditor/lang/zh-cn/zh-cn.js"></script>
    <!-- 时间控件 -->
    <script src="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/WdatePicker.js" defer="defer"></script>

    <script src="${jsRoot}operate/agent.handle.js"></script>
    <!-- ================== 结束页面级JavaScrip调用 ================== -->
</@c.html>
